from django.db import models

# Create your models here.

class MqttServer(models.Model):
    id = models.AutoField("服务器ID",primary_key=True)
    name = models.CharField("服务器名称",max_length=100,blank=False,default='')
    ip_address = models.CharField("服务器IP", max_length=100, blank=False, default='')
    port = models.CharField("服务器端口", max_length=100, blank=False, default='')
    user_names = models.CharField("用户名", max_length=100, blank=False, default='')
    password = models.CharField("密码", max_length=100, blank=False, default='')

    class Meta:
        db_table = 'mqtt_server'  # 指明数据库表名

class MqttTopic(models.Model):
    id = models.AutoField("订阅id",primary_key=True)
    topic = models.CharField("订阅名称",max_length=100,blank=False,default='')

    class Meta:
        db_table = 'mqtt_topics'






